package com.norbitltd.guavaleaves.java.lang;

import com.google.common.base.Function;

public class EnumPredicates extends ObjectPredicates {
	
	public static <T extends Enum<T>> Function<T, String> getName() {
		return new Function<T, String>() {
			public String apply(T input) {
				return input.name();
			};
		};
	}
	
	public static <T extends Enum<T>> Function<T, Integer> getOrdinal() {
		return new Function<T, Integer>() {
			public Integer apply(T input) {
				return input.ordinal();
			};
		};
	}
}
